resource "equinix_metal_device" "device_<%= obj['ID'] %>" {
    hostname         = "<%= provision['HOSTNAME'] %>"
    plan             = "<%= provision['PLAN'] %>"
    metro            = "<%= provision['METRO'] %>"
    operating_system = "<%= provision['OS'] %>"
    project_id       = "<%= provision['PROJECT']%>"
    billing_cycle    = "hourly"
    user_data        = "<%= obj['user_data'] %>"
    tags             = ["OpenNebula", "ONE_ID=<%= obj['ID'] %>"]
}

output "device_<%= obj['ID'] %>_ip" {
  value = equinix_metal_device.device_<%= obj['ID'] %>.network[0].address
}

output "device_<%= obj['ID'] %>_id" {
  value = equinix_metal_device.device_<%= obj['ID'] %>.id
}

